<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./vue.js"></script>
    <script>
      /*
        选项式框架
        1. data定义vm的属性（数据）
        2. methods中定义vm方法
        */
      const vm = new Vue({
        data: {
          username: "jack",
          age: 20,
        },
        methods: {
          say: function () {
            console.log(this.username, this.age);
          },
        },
      });
      console.log(vm.username);
      console.log(vm.age);
      vm.say();
    </script>
  </body>
</html>
